
#include "stripper.h"

#include <iostream>
#include <string>


using namespace std;

int main(){


  cout << "\n\t\t example to test the stripper class.";
  cout << "\n\tstripper class strips strings in FRONT or BACK directions given a tag substring.\n\n";
  cout << "\n\t\t\t ---------------\n\n";

  stripper f;
  string a="egewr rewgbv3 werg # wfvw  X wrfg X wqfqw Y";

  cout << "\n\t --->  string: \"" << a << "\"";

  string in1 = "#";
  string in2 = "X";
  stripper::stripMode direction = stripper::FRONT;

  cout << "\n\n\t status *before* stripping:";
  cout << "\n\t\t tag is found? (bool) " << f.tagFound();
  cout << "\n\t\t existStatus (enum): " << f.getStatus() << "  - 0 is UNDEFINED.\n";

  cout << "\n\t ---> FRONT #: \"" << f.strip( a, in1,  direction ) << "\"";
  cout << "\n\t --->  BACK X: \"" << f.strip( a, "X", stripper::BACK) << "\"";

  cout << "\n\n\n\t status *after* stripping in BACK direction:";
  cout << "\n\t\t tag is found? (bool) " << f.tagFound();
  cout << "\n\t\t existStatus (enum): " << f.getStatus() << "  - 4 is BACK_DIRECTION.";
  cout << "\n\n\t read stripper.h file to see all possible existStatus values.\n\n";

  cout << "\n\t select words between the two \"X\":";
  cout << "\n\t ---> BACK X composition with FRONT X: \"" << f.strip( f.strip( a, "X", stripper::BACK ), "X", stripper::FRONT ) << "\"";

  cout << "\n\n\t select words before \"#\" and after \"g X w\":";
  cout << "\n\t ---> string concatenation: \"" << f.strip( a, "#", stripper::FRONT ) + f.strip(a, "g X w", stripper::BACK ) << "\"";


  cout << endl << endl;

  return 0;
}

